package com.zjhn.ds.controller.pc;

import com.alibaba.fastjson.JSON;
import com.zjhn.ds.common.BizResult;
import com.zjhn.ds.domain.dto.pc.DsControlCenterDto;
import com.zjhn.ds.domain.dto.pc.DsDeviceMonitorDto;
import com.zjhn.ds.domain.dto.pc.DsMonitorCenterDto;
import com.zjhn.ds.domain.entity.jlw.Group;
import com.zjhn.ds.service.MaintenanceChangeService;
import com.zjhn.ds.service.MonitorService;
import com.zjhn.ds.utils.RestHighLevelUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @BelongsProject: ds_jlw
 * @BelongsPackage: com.zjhn.ds.controller.pc
 * @Author: sxt
 * @CreateTime: 2023-12-13  16:30
 * @Description:
 * @Version: 1.0
 */
@Slf4j
@RestController
@RequestMapping("/jlw/noAuth")
@Api(tags = "无权限接口")
public class NoAuthController {

    @Resource
    private MonitorService monitorService;

    @Resource
    private MaintenanceChangeService maintenanceChangeService;

    @Resource
    private RestHighLevelUtils restHighLevelUtils;

    @ApiOperation("迪赛针织设备运行监控台")
    @PostMapping("/dsDeviceMonitor")
    public BizResult<List<DsDeviceMonitorDto>> dsDeviceMonitor(@RequestBody List<String> groupIds) {
        log.info("====[INFO]=========MonitorController====dsDeviceMonitor groupIds:{}", JSON.toJSONString(groupIds));
        return monitorService.dsDeviceMonitor(groupIds);
    }

    @ApiOperation("迪赛针织生产指挥中心")
    @PostMapping("/dsControlCenter")
    public BizResult<DsControlCenterDto> dsControlCenter() {
        log.info("====[INFO]=========MonitorController====dsControlCenter");
        return monitorService.dsControlCenter();
    }

    @ApiOperation("迪赛针织编制车间现场监控中心")
    @PostMapping("/dsMonitorCenter")
    public BizResult<DsMonitorCenterDto> dsMonitorCenter() {
        log.info("====[INFO]=========MonitorController====dsMonitorCenter");
        return monitorService.dsMonitorCenter();
    }

    @ApiOperation("查询车间小组")
    @PostMapping("/groupList")
    public BizResult<List<Group>> groupList() {
        log.info("====[INFO]========GroupController====groupList");
        return monitorService.groupList();
    }

}
